package com.itheima.goods.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.itheima.goods.pojo.Goods;
import entity.PageResult;
import entity.Result;

import java.util.List;

/**
 * @author wang
 * @description
 * @date 2021/7/29 13:03
 */
public interface GoodsService extends IService<Goods> {
    List<Goods> findAll();

    PageResult<Goods> findPage4Get(Integer page, Integer size);

    PageResult<Goods> findPage4Post(Integer page, Integer size,Goods goods);

    Goods findById(Integer id);

    boolean deleteById(Integer id);

    boolean add(Goods goods);

    boolean updateGoods(Goods goods, Integer id);

    Result buy(Integer goodId, Integer buyNum);
}
